# Maintainer: Maxime Gauduin <alucryd@archlinux.org>
# Contributor: Alexsandr Pavlov <kidoz@mail.ru>

pkgname=ruby-mime-types
pkgver=3.4.1
pkgrel=1
pkgdesc='MIME Content-Type database'
arch=('any')
url='http://mime-types.rubyforge.org'
license=('GPL2' 'MIT' 'PerlArtistic')
depends=('ruby' 'ruby-mime-types-data')
options=('!emptydirs')
source=("https://rubygems.org/downloads/mime-types-${pkgver}.gem")
noextract=("mime-types-${pkgver}.gem")
sha256sums=('6bcf8b0e656b6ae9977bdc1351ef211d0383252d2f759a59ef4bcf254542fc46')

package() {
  local _gemdir="$(ruby -e'puts Gem.default_dir')"

  gem install --ignore-dependencies --no-user-install -N -i "${pkgdir}"/${_gemdir} mime-types-${pkgver}.gem
  find "${pkgdir}" -type f -name *.gem -delete

  install -dm 755 "${pkgdir}"/usr/share/licenses/ruby-mime-types
  ln -s ${_gemdir}/gems/mime-types-${pkgver}/Licence.rdoc "${pkgdir}"/usr/share/licenses/ruby-mime-types/
}

# vim: ts=2 sw=2 et:
